package beans;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.beans.VetoableChangeListener;
import java.beans.VetoableChangeSupport;
import java.io.Serializable;

public class Creneau implements Serializable {

	private static final long serialVersionUID = -6750512608692071353L;
	
	private Salle salle;
	private Enseignant enseignant;
	private Type type;
	private EC eC;
	private Jours jourReservationSalle;
	private int horaireDebut;
	private int horaireFin;
	
	PropertyChangeSupport changeSupport;
	VetoableChangeSupport vetoableSupport;
	
	public Creneau() {}
	
	public Creneau(Salle salle, Enseignant enseignant, Type type, EC eC,
			Jours jourReservationSalle, int horaireDebut, int horaireFin) {
		super();
		this.salle = salle;
		this.enseignant = enseignant;
		this.type = type;
		this.eC = eC;
		this.jourReservationSalle = jourReservationSalle;
		this.horaireDebut = horaireDebut;
		this.horaireFin = horaireFin;
	}

	public Salle getSalle() {
		return salle;
	}
	
	public void setSalle(Salle salle) {
		this.salle = salle;
	}
	
	public Enseignant getEnseignant() {
		return enseignant;
	}
	
	public void setEnseignant(Enseignant enseignant) {
		this.enseignant = enseignant;
	}
	
	public Type getType() {
		return type;
	}
	
	public void setType(Type type) {
		this.type = type;
	}
	
	public EC geteC() {
		return eC;
	}
	
	public void seteC(EC eC) {
		this.eC = eC;
	}
	
	public Jours getJourReservationSalle() {
		return jourReservationSalle;
	}

	public void setJourReservationSalle(Jours jourReservationSalle) {
		this.jourReservationSalle = jourReservationSalle;
	}

	public int getHoraireDebut() {
		return horaireDebut;
	}

	public void setHoraireDebut(int horaireDebut) {
		this.horaireDebut = horaireDebut;
	}

	public int getHoraireFin() {
		return horaireFin;
	}

	public void setHoraireFin(int horaireFin) {
		this.horaireFin = horaireFin;
	}

	public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.addPropertyChangeListener(listener);
	}
	
	public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.removePropertyChangeListener(listener);
	}
	
	public synchronized void addVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.addVetoableChangeListener(listener);
	}
	
	public synchronized void removeVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.removeVetoableChangeListener(listener);
	} 
}
